<?php

namespace app\api\controller;

use app\api\model\User as UserModel;
use app\api\service\User as UserService;


class LightingPlay
{
    public function generateUrl(){
        import('lighting_play.LightingPlay',EXTEND_PATH,'.php');
        $lighting = new \LightingPlay();
        $user_id = UserService::getUserIdByToken();
        $user = UserModel::get($user_id);
        $data = [
            'openid'=>$user_id,
            'nick'=>'mxq'.$user_id,
            'avatar'=>$user['avatar'],
            'phone'=>$user['mobile'],
        ];
        $extra = [
//            'gid' => $gid;
        ];
        $url = $lighting->redirectUrl($data,$extra);
        echo $url;
    }
}